-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add testeditor to devtest for easier testing. #15206
base: master
Are you sure you want to change the base?
Conversation
I don't think this editor scales well enough. Each API function needs a wrapper of 10 lines (in total). local funcs = {
-- [1] = getter, [2] = setter
clouds = { "get_clouds", "set_clouds" },
sky = {
function(p) return p:get_sky(true); end,
"set_sky"
}
-- ...
}
local function exec(player, func, ...)
if type(func) == "string" then
return player[func](player, ...)
end
if type(func) == "function" then
return func(player, ...)
end
-- error message
return nil
end
-- in core.register_chatcommand : skim through the table
local def = funcs[param]
if def then
return editor_formspec_create(name, def)
end
return false, "Unknown command" Verbose descriptions are not needed. The developers who would use this tool do know what kind of functions we're testing. |
Personally I don't need this. I'd either write my own little test mods, or drag something simpler, but more powerful in: A simple Then you can just do something like |
This is what I'm using (yes, a fork of a fork, modified so that it is more usable, ignoring code quality. take it as inspiration for features or so): https://github.com/Desour/luacmd But there's no reason why we can't have both. A node with a formspec where you can store code snippets would also be nice. And maybe such that you can easily add buttons, so PRs and issues can for reproduction just provide a configuration for this node. |
@appgurueu For example, if I want to check all player-specific graphic settings before release, I have to write many lines of With It definitely can be done as a separate mod. I created PR because I find it potentially helpful for Luanti testing purposes. But if other code devs do not see the benefits of this, let's close this PR. |
I am not opposed to this PR. I was just saying that I don't find it very useful personally. I agree with Desour that "there's no reason why we can't have both". So feel free to move forward. I may add a
I think you might have misunderstood me. I just said that I often test features added in PRs via a "testbed" mod of mine, not that this has no place in devtest. |
0768f3c
to
73ad9d1
Compare
@SmallJoker Wrappers reworked to the table. |
Make testing of Minetest a little easier.
It adds a formspec editor for armor groups, nametags, physics override, hud flags, sky, sun, moon, stars, clouds, lighting, flags, and maybe I forgot to notice something.
To do
This PR Ready for Review.
How to test
Run the devtest game and try the command
player_editor
.